package me.atbar.moonlib.storage.mysql;

import lombok.Getter;

/**
 * @author Administrator
 */
public class SqlConfig {

    @Getter
    public final static String DIVER = "com.mysql.jdbc.Driver";
    @Getter
    private final String host;
    @Getter
    private final String user;
    @Getter
    private final String password;
    @Getter
    private final String database;
    @Getter
    private final boolean ssl;
    @Getter
    private final String port;

    public SqlConfig(final String host, final String user, final String password, final String database, final boolean ssl, final String port) {
        this.host = host;
        this.user = user;
        this.password = password;
        this.database = database;
        this.ssl = ssl;
        this.port = port;
    }

    public String getDatabaseURL() {
        return "jdbc:mysql://" + this.host + ":" + this.port + "/" + this.database + "?autoReconnect=true&useSSL=" + this.ssl + "?serverTimezone=UTC";
    }

}
